import request from  '../index'

/**
 * 权限管理人员列表
 * @author xiaoYu
 * @date
 */

export function powerList () {
    return new Promise((resolve, reject) => {
        const url = '/powerPeople'
        request.get({ url }).then(res => {
            return resolve(res)
        })
        .catch(err => {
            reject(err)
        })
    })
}

/**
 * 权限管理-修改
 * @author xiaoYu
 * @deprecated
 */
export function powerEdit (params) {
    return new Promise((resolve, reject) => {
        const path = '/powerEdit'
        request.post(path, params).then(res => {
            return resolve(res)
        })
        .catch(err => {
            reject(err)
        })
    })
}

/**
 * 权限管理-删除
 * @author xiaoYu
 * @date
 */
export function powerDel(id) {
    return new Promise((resolve, reject) => {
        const path = '/powerDel',
        params = { 'id': id }
        request.post(path, params).then(res => {
            return resolve(res)
        })
        .catch(err => {
            reject(err)
        })
    })
}